# -*- mode: python; coding: utf-8; -*-
##--------------------------------------------------------------------------##
##
## Copyright (C) 1998-2003 Markus Oberhumer <markus@oberhumer.com>
## Copyright (C) 2003 Mt. Hood Playing Card Co.
## Copyright (C) 2005-2010 Skomoroh <skomoroh@users.sourceforge.net>
## Copyright (C) 2010-2013 Jeremy Austin-Bardo <tjaustinbardo@gmail.com>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
##--------------------------------------------------------------------------##
__docformat__ = "restructuredtext en"

from .. import pilelib as stack
from .. import hint


class Bristol_Hint(hint.CautiousDefaultHint):

    BONUS_CREATE_EMPTY_ROW = 0
    BONUS_CAN_DROP_ALL_CARDS = 0
    BONUS_CAN_CREATE_EMPTY_ROW = 0

    def score_move_pile(self, from_stack, to_stack, pile, rpile):
        """
        score_move_pile(from_stack:Stack, to_stack:Stack, pile:seq(Card ...),
          rpile:seq(Card ...)) -> None

        Score moving a pile from stack to to stack.

        Augment **from_stack** builds **to_stack** prefer not clear stack.
        """
        if not from_stack in self._stacks['set']['reserves']:
            self._score -= 10000
            if len(pile) == len(from_stack.cards):
                self._score
                return
        return super(Bristol_Hint, self).score_move_pile(from_stack, to_stack,
                                                         pile, rpile)


class Interment_Hint(hint.SortHeldCautiousHint):

    @property
    def _to_piles(self):
        """
        _to_piles() -> seq

        Rank should be found from this pile top card. Default Game.s.xwastes.
        """
        return self.game.s['xwastes']


class NewYork_RowStack(stack.GapFromReserveTalonBuildMethod,
                       stack.AC_RowStack):
    """
    Build in rank by alt color. Base must be from reserve or talon.
    """
    pass


class Gotham_RowStack(stack.GapFromReserveTalonBuildMethod,
                      stack.RK_RowStack):
    """
    Build in rank alone. Base must be from reserve or talon.
    """
    pass


class Dover_RowStack(stack.GapFromReserveBuildMethod, stack.RK_RowStack):
    """
    Build in rank alone. Base must be from reserve.
    """
    pass